<template>
  <el-dialog
    v-bind="$attrs"
    :title="$t('flyparam.undo')"
    v-on="$listeners"
    @closed="close"
    @open="open"
  >
    <div class="text-center">
      <el-radio-group v-model="undoType">
        <el-radio :label="2">{{ $t('flyparam.undo_cur_page') }}</el-radio>
        <el-radio :label="1">{{ $t('flyparam.undo_all') }}</el-radio>
      </el-radio-group>
    </div>
    <template #footer>
      <div>
        <el-button size="small" @click="close">{{
          $t('common.cancel')
        }}</el-button>
        <el-button type="primary" size="small" @click="confirm">{{
          $t('common.confirm')
        }}</el-button>
      </div></template
    >
  </el-dialog>
</template>

<script>
export default {
  data() {
    return {
      undoType: 2
    }
  },
  methods: {
    close() {
      this.undoType = 2
      this.$emit('update:model-value', false)
    },
    open() {},
    confirm() {
      this.$emit('confirm', this.undoType)
      this.$emit('update:model-value', false)
    }
  }
}
</script>

<style>
</style>
